package com.flash.javamate.utils;

import com.flash.javamate.handler.ChangeNameHandler;

import java.io.File;

/**
 * @author sunyiming
 * @date 2018/8/21
 */
public class OperateFileUtils {

    public static void changeName(File[] files, ChangeNameHandler handler) {
        for (File file : files) {
            if (file.isFile()) {
                file.renameTo(new File(file.getParentFile(), handler.changeName(file.getName())));
            }
        }
    }

}
